home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 2: CDPD 1 / Almathera Ten on Ten - Disc 2: CDPD 1.iso / pd / 051-075 / 069 / monproc / givepkt.c < prev    next >
C/C++ Source or Header  |  1995-03-13  |  4KB  |  220 lines

  1. /* givepkt.c - This doesn't do much, it takes a packet type (number) and
  2.  *     gives you something more readable on stdout.
  3.  *
  4.  *      Phillip Lindsay (c) 1987 Commodore-Amiga Inc. 
  5.  * You may use this source as long as the copyright notice is left intact.
  6.  * 
  7.  */
  8.  
  9. #include <exec/types.h>
  10. #include <libraries/dosextens.h>
  11.  
  12. /* packet types */
  13. #define _ACTION_NIL            0L
  14. #define _ACTION_GET_BLOCK       2L
  15. #define _ACTION_SET_MAP           4L
  16. #define _ACTION_DIE           5L
  17. #define _ACTION_EVENT           6L
  18. #define _ACTION_CURRENT_VOLUME       7L
  19. #define _ACTION_LOCATE_OBJECT       8L
  20. #define _ACTION_RENAME_DISK       9L
  21. #define _ACTION_FREE_LOCK      15L
  22. #define _ACTION_DELETE_OBJECT      16L
  23. #define _ACTION_RENAME_OBJECT      17L
  24. #define _ACTION_MORE_CACHE      18L
  25. #define _ACTION_COPY_DIR      19L
  26. #define _ACTION_WAIT_CHAR      20L
  27. #define _ACTION_SET_PROTECT      21L
  28. #define _ACTION_CREATE_DIR      22L
  29. #define _ACTION_EXAMINE_OBJECT      23L
  30. #define _ACTION_EXAMINE_NEXT      24L
  31. #define _ACTION_DISK_INFO      25L
  32. #define _ACTION_INFO              26L
  33. #define _ACTION_FLUSH          27L
  34. #define _ACTION_SET_COMMENT      28L
  35. #define _ACTION_PARENT          29L
  36.  
  37. /* This is normally a returning timer device request. (internal) */
  38. #define _ACTION_TIMER          30L
  39.  
  40. #define _ACTION_INHIBIT          31L
  41. #define _ACTION_DISK_TYPE      32L
  42. #define _ACTION_DISK_CHANGE      33L
  43. #define _ACTION_SET_FILE_DATE      34L
  44. #define _ACTION_READ           82L
  45. #define _ACTION_WRITE          87L
  46. #define _ACTION_SET_SCREEN_MODE     994L
  47. /*
  48.  * When a handler internally sends a device i/o request they are sent using
  49.  * their process port and in the form of a "packet" the packet types below:
  50.  * (ACTION_TIMER above also falls into this catagory)
  51.  */
  52. #define _ACTION_READ_INTERNAL    1001L    
  53. #define _ACTION_WRITE_INTERNAL    1002L   
  54.  
  55. #define _ACTION_FIND_INPUT    1005L
  56. #define _ACTION_FIND_OUTPUT    1006L
  57. #define _ACTION_CLOSE        1007L
  58. #define _ACTION_SEEK        1008L
  59.  
  60. void givepkt(pkt)
  61. struct DosPacket *pkt;
  62. {
  63.  switch(pkt->dp_Type)
  64.   {
  65.     case _ACTION_NIL:
  66.      puts("ACTION_NIL");
  67.      break;
  68.  
  69.     case _ACTION_GET_BLOCK:
  70.      puts("ACTION_GET_BLOCK");
  71.      break;
  72.  
  73.     case _ACTION_SET_MAP:
  74.      puts("ACTION_SET_MAP");
  75.      break;
  76.  
  77.     case _ACTION_DIE:
  78.      puts("ACTION_DIE");
  79.      break;
  80.  
  81.     case _ACTION_EVENT:
  82.      puts("ACTION_EVENT");
  83.      break;
  84.  
  85.     case _ACTION_CURRENT_VOLUME:
  86.      puts("ACTION_CURRENT_VOLUME");
  87.      break;
  88.  
  89.     case _ACTION_LOCATE_OBJECT:
  90.      puts("ACTION_LOCATE_OBJECT");
  91.      break;
  92.  
  93.     case _ACTION_RENAME_DISK:
  94.      puts("ACTION_RENAME_DISK");
  95.      break;
  96.  
  97.     case _ACTION_FREE_LOCK:
  98.      puts("ACTION_FREE_LOCK");
  99.      break;
  100.  
  101.     case _ACTION_DELETE_OBJECT:
  102.      puts("ACTION_DELETE_OBJECT");
  103.      break;
  104.  
  105.     case _ACTION_RENAME_OBJECT:
  106.      puts("ACTION_RENAME_OBJECT");
  107.      break;
  108.  
  109.     case _ACTION_MORE_CACHE:
  110.      puts("ACTION_MORE_CACHE");
  111.      break;
  112.  
  113.     case _ACTION_COPY_DIR:
  114.      puts("ACTION_COPY_DIR");
  115.      break;
  116.  
  117.     case _ACTION_WAIT_CHAR:
  118.      puts("ACTION_WAIT_CHAR");
  119.      break;
  120.  
  121.     case _ACTION_SET_PROTECT:
  122.      puts("ACTION_SET_PROTECT");
  123.      break;
  124.  
  125.     case _ACTION_CREATE_DIR:
  126.      puts("ACTION_CREATE_DIR");
  127.      break;
  128.  
  129.     case _ACTION_EXAMINE_OBJECT:
  130.      puts("ACTION_EXAMINE_OBJECT");
  131.      break;
  132.  
  133.     case _ACTION_EXAMINE_NEXT:
  134.      puts("ACTION_EXAMINE_NEXT");
  135.      break;
  136.  
  137.     case _ACTION_DISK_INFO:
  138.      puts("ACTION_DISK_INFO");
  139.      break;
  140.  
  141.     case _ACTION_INFO:
  142.      puts("ACTION_INFO");
  143.      break;
  144.  
  145.     case _ACTION_FLUSH:
  146.      puts("ACTION_FLUSH");
  147.      break;
  148.  
  149.     case _ACTION_SET_COMMENT:
  150.      puts("ACTION_SET_COMMENT");
  151.      break;
  152.  
  153.     case _ACTION_PARENT:
  154.      puts("ACTION_PARENT");
  155.      break;
  156.  
  157.     case _ACTION_TIMER:
  158.      puts("ACTION_TIMER");
  159.      break;
  160.  
  161.     case _ACTION_INHIBIT:
  162.      puts("ACTION_INHIBIT");
  163.      break;
  164.  
  165.     case _ACTION_DISK_TYPE:
  166.      puts("ACTION_DISK_TYPE");
  167.      break;
  168.  
  169.     case _ACTION_DISK_CHANGE:
  170.      puts("ACTION_DISK_CHANGE");
  171.      break;
  172.  
  173.     case _ACTION_SET_FILE_DATE:
  174.      puts("ACTION_SET_FILE_DATE");
  175.      break;
  176.  
  177.     case _ACTION_READ:
  178.      puts("ACTION_READ");
  179.      break;
  180.  
  181.     case _ACTION_WRITE:
  182.      puts("ACTION_WRITE");
  183.      break;
  184.  
  185.     case _ACTION_SET_SCREEN_MODE:
  186.      puts("ACTION_SET_SCREEN_MODE");
  187.      break;
  188.  
  189.     case _ACTION_READ_INTERNAL:
  190.      puts("ACTION_READ_INTERNAL");
  191.      break;
  192.  
  193.     case _ACTION_WRITE_INTERNAL:
  194.      puts("ACTION_WRITE_INTERNAL");
  195.      break;
  196.  
  197.     case _ACTION_FIND_INPUT:
  198.      puts("ACTION_FIND_INPUT");
  199.      break;
  200.  
  201.     case _ACTION_FIND_OUTPUT:
  202.      puts("ACTION_FIND_OUTPUT");
  203.      break;
  204.  
  205.     case _ACTION_CLOSE:
  206.      puts("ACTION_CLOSE");
  207.      break;
  208.  
  209.     case _ACTION_SEEK:
  210.      puts("ACTION_SEEK");
  211.      break;
  212.  
  213.     default:
  214.      printf("Unknown packet: %ld\n",pkt->dp_Type);
  215.      break;
  216.   }
  217. }
  218.  
  219. /* end of givepkt.c */
  220.